package com.thesis.teacher.controller;

import com.thesis.manage.common.controller.AbstractController;
import com.thesis.manage.common.utils.AliOSSUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author php
 * @date 2018/3/28
 */
@RequestMapping("/upload")
@RestController
public class UploadController extends AbstractController {

    @PostMapping("/file")
    public Map<String, Object> upload(MultipartFile file) {
        return buildMessage(() -> AliOSSUtil.upload(file));
    }
}
